const koaRouter = require('@koa/router')
const {verifyUser,handlePassword} =require('../middleware/user.middleware')
const userController=require('../controller/user.controller')
const userRouter = new koaRouter({ prefix: '/users' })

 
// 定义用户创建或注册
// userRouter.post('',userController) 函数的方式
userRouter.post('/',verifyUser,handlePassword,userController.create)
userRouter.get('/avatar/:userId', userController.avatarInfo);
// userRouter.get('/list', (ctx, next) => {
//     ctx.body = 'user list'
// })
module.exports=userRouter 